<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<link rel="stylesheet" href="css/bootstrap-3.3.7/css/bootstrap.min.css" />
<link rel="stylesheet" href="css/register.css" />
<link rel="stylesheet" href="css/listCommon.css" />
<link rel="stylesheet" href="css/evaluation.css" />
<style>
    .modal-backdrop {
        position: inherit;
    }
</style>
<jsp:include page="../common/nav.jsp"></jsp:include>
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="purchaseOrder">
        <div class="formTitle">采购申请单信息</div>
        <div class="trackInfomation">
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <span>*</span>
                        <label>标题：</label>
                        <input id="title" name="title" type="text" class="form-control" placeholder="请输入标题" value="${requestScope.purchasingRequisition.title}" disabled>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <span id="">*</span>
                        <label>采购类型：</label>
                        <select id="type" name="type" class="form-control" disabled>
                            <option value="">请选择采购类型</option>
                            <c:forEach items="${requestScope.typeMap}" var="typeMap">
                                <c:if test="${typeMap.key == requestScope.purchasingRequisition.type}">
                                    <option value="${typeMap.key}" selected>${typeMap.value}</option>
                                </c:if>
                                <c:if test="${typeMap.key != requestScope.purchasingRequisition.type}">
                                    <option value="${typeMap.key}">${typeMap.value}</option>
                                </c:if>
                            </c:forEach>
                        </select>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <span>*</span>
                        <label>期望交货时间：</label>
                        <input id="scheduledTime" name="scheduledTime" type="date" class="form-control" value="${requestScope.purchasingRequisition.scheduledTime}" disabled>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <span>*</span>
                        <label>采购原因：</label>
                        <input id="reason" name="reason" type="text" class="form-control" placeholder="请输入采购原因" value="${requestScope.purchasingRequisition.reason}" disabled>
                    </div>
                </div>
                <div class="col-md-12">
                    <div class="form-group">
                        <span>&nbsp;&nbsp;</span>
                        <label class="fuyanText">附言：</label>
                        <textarea id="remark" name="remark" class="form-control fuyan" rows="3" placeholder="请输入附言" style="margin-left: 0;height:80px !important;" disabled>${requestScope.purchasingRequisition.remark}</textarea>
                    </div>
                </div>
            </div>
        </div>
        <div class="formTitle">采购人信息</div>
        <div class="trackInfomation">
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <label>申请人：</label>
                        <input id="createUserName" type="text" class="form-control" value="${requestScope.purchasingRequisition.createUserName}" disabled>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label>公司代码：</label>
                        <input id="companyCode" name="companyCode" type="text" class="form-control" value="${requestScope.purchasingRequisition.companyCode.concat(' - '.concat(requestScope.purchasingRequisition.companyName))}" disabled>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label>申请部门：</label>
                        <input id="departmentName" name="departmentName" type="text" class="form-control" value="${requestScope.purchasingRequisition.departmentName}" disabled>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label>电子邮箱：</label>
                        <input id="mailbox" type="text" class="form-control" value="${requestScope.purchasingRequisition.mailbox}" disabled>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label>手机号码：</label>
                        <input id="tel" type="text" class="form-control" value="${requestScope.purchasingRequisition.tel}" disabled>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label>固定电话：</label>
                        <input id="landLine" type="text" class="form-control" value="${requestScope.purchasingRequisition.landLine}" disabled>
                    </div>
                </div>
                <div class="col-md-12">
                    <div class="form-group">
                        <label class="fuyanText">收货地址：</label>
                        <textarea id="address" name="address" class="form-control fuyan" rows="3" placeholder="请输入收货地址" style="margin-left: 0;height:80px !important;" disabled>${requestScope.purchasingRequisition.address}</textarea>
                    </div>
                </div>
            </div>
        </div>
        <div class="formTitle">
            物资信息
        </div>
        <div class="tableWrap">
            <table class="table table-bordered">
                <thead id="subBody">
                <tr>
                    <th width="5%">序号</th>
                    <th>物料编码</th>
                    <th>品牌</th>
                    <th>物资名称</th>
                    <th>型号</th>
                    <th>类目</th>
                    <th>数量</th>
                    <th>单位</th>
                    <th width="10%">附件</th>
                    <th>状态</th>
                    <th width="20%">附言</th>
                </tr>
                <c:if test="${empty requestScope.purchasingRequisition.subs}">
                    <tr id="nothing">
                        <td colspan="11" style="color: #bbbbbb">无物资信息</td>
                    </tr>
                </c:if>
                <c:if test="${not empty requestScope.purchasingRequisition.subs}">
                    <c:forEach items="${requestScope.purchasingRequisition.subs}" var="sub" varStatus="index">
                        <tr id="${"materialLine".concat(index.count)}">
                            <td id="${"materialNo".concat(index.count)}">${index.count}</td>
                            <td id="${"detailId".concat(index.count)}" style="display: none">${sub.id}</td>
                            <td id="${"materialId".concat(index.count)}" style="display: none">${sub.materialId}</td>
                            <td id="${"materialCode".concat(index.count)}">${sub.materialCode}</td>
                            <td id="${"materialBrand".concat(index.count)}">${sub.materialBrand}</td>
                            <td id="${"materialName".concat(index.count)}">${sub.materialName}</td>
                            <td id="${"materialModel".concat(index.count)}">${sub.materialModel}</td>
                            <td id="${"materialCategory".concat(index.count)}">${sub.materialCategory}</td>
                            <td><input id="${"quantity".concat(index.count)}" type="number" style="border:1px solid #ddd;width:60px;border-radius:4px;" value="${sub.quantity}" disabled></td>
                            <td id="${"materialUnit".concat(index.count)}">${sub.materialUnit}</td>
                            <c:if test="${'' == sub.accessory}">
                                <td id="${"subFilePath".concat(index.count)}" style="display: none"></td>
                                <td id="${"subFileTd".concat(index.count)}"></td>
                            </c:if>
                            <c:if test="${'' != sub.accessory}">
                                <td id="${"subFilePath".concat(index.count)}">
                                    <a style="text-decoration: none; color: black" download="${sub.accessoryName}" href="${sub.accessory}">${sub.accessoryName}</a>
                                </td>
                                <td id="${"subFileTd".concat(index.count)}" style="display: none"></td>
                            </c:if>
                            <td id="${"subStatus".concat(index.count)}" style="display: none">${sub.status}</td>
                            <td id="${"subStatusText".concat(index.count)}">${requestScope.subStatusMap[sub.status]}</td>
                            <td><input id="${"subRemark".concat(index.count)}" type="text" style="border:1px solid #ddd;width:100%;border-radius:4px;" value="${sub.remark}" disabled></td>
                        </tr>
                    </c:forEach>
                </c:if>
                </thead>
            </table>
        </div>
        <div class="formTitle">
            附件信息
        </div>
        <div class="tableWrap">
            <table class="table table-bordered">
                <thead id="fileBody">
                <tr>
                    <th width="5%">序号</th>
                    <th>附件名称</th>
                </tr>
                <c:if test="${empty requestScope.purchasingRequisition.accessory}">
                    <tr id="fileNothing">
                        <td colspan="2" style="color: #bbbbbb">无附件信息</td>
                    </tr>
                </c:if>
                <c:if test="${not empty requestScope.purchasingRequisition.accessory}">
                    <c:forEach items="${requestScope.purchasingRequisition.fileMap}" var="file" varStatus="index">
                        <tr id="${"fileLine".concat(index.count)}">
                            <td id="${"fileNo".concat(index.count)}">${index.count}</td>
                            <td id="${"fileName".concat(index.count)}">
                                <a style="text-decoration: none; color: black" download="${file.value}" href="${file.key}">${file.value}</a>
                            </td>
                        </tr>
                    </c:forEach>
                </c:if>
                </thead>
            </table>
        </div>
        <div class="trackSubmit">
            <button type="button" onclick="history.back(-1);">返回</button>
        </div>
    </div>
</div>
<script src="css/bootstrap-3.3.7/js/jquery-2.1.4.min.js" type="text/javascript" charset="utf-8"></script>
<script src="css/bootstrap-3.3.7/js/bootstrap.js" type="text/javascript" charset="utf-8"></script>